<?php
	$frm_contact = $this->frmContact;
	$thong_tin_cty = $this->thong_tin_cty;
	$chi_nhanh = $this->chi_nhanh;
?>

<div id="wrapcontent">
	<div class="ctComponent">
		<div class="contact">
			<div class="contact-title">
				<h2>Liên hệ</h2>
				<span>Hãy điền đầy đủ thông tin rồi gửi email chúng tôi. Chúng tôi sẽ liên lạc với bạn trong thời gian sớm nhất</span>
			</div>
			<div class="contact-contactinfo">
				<div class="company">
					<p class="company-name"><?php echo $thong_tin_cty['cty_ten']; ?></p>
					<p><span>Địa chỉ: </span><a href="#map_canvas" onclick="displayLocation('<?php echo $thong_tin_cty['cty_dia_chi']; ?>');"><?php echo $thong_tin_cty['cty_dia_chi']; ?></a></p>
					<p><span>Website: </span><a href="http://kenhnhatro.net">http://kenhnhatro.net</a></p>
					<p><span>HotLine: </span><?php echo $thong_tin_cty['cty_hotline']; ?></p>
					<?php $nickname = explode ('-', $thong_tin_cty['cty_nick_skype']); ?>
					<a href="skype:<?php echo $nickname[0]; ?>?chat"><img src="http://mystatus.skype.com/mediumicon/<?php echo $nickname[0]; ?>" title="<?php echo $nickname[0]; ?>" />Liên lạc qua Skype</a>
				</div>
				<?php
					if (count($chi_nhanh) > 0) {
						foreach ($chi_nhanh as $val) {
							$html = '<div class="company">';
							$html .= '<p class="company-name">' . $val->ten_cty . '</p>';
							$html .= '<p><span>Địa chỉ: </span><a href="#map_canvas" onclick="displayLocation(\'' . $val->dia_chi . '\');">' . $val->dia_chi . '</a></p>';
							$html .= '<p><span>Điện thoại: </span>' . $val->dien_thoai . '</p>';
							if (!empty($val->fax))
								$html .= '<p><span>Fax: </span>' . $val->fax . '</p>';
							if (!empty($val->email))
								$html .= '<p><span>Email: </span>' . $val->email . '</p>';
							$html .= '</div>';
							echo $html;
						}
					} 
				?>
			</div>
			<script type="text/javascript">
				$(document).ready(function() {
			
					$('#refreshcaptcha').click(function() { 
						$.ajax({ 
							url: '/member/refresh',
							dataType:'json', 
							success: function(data) { 
								$('#<?php echo $frm_contact->getName(); ?> span img').attr('src', data.src); 
								$('#captcha-id').attr('value', data.id); 
							}
						}); 
					});
				});
			
			</script>
			<div class="contact-form">
				<?php echo '<form id="' . $frm_contact->getId() . '" method="' . $frm_contact->getMethod() . '" action="" enctype="' . $frm_contact->getEnctype() . '" name="' . $frm_contact->getName() . '">'; ?>
				<dl>
					<?php 
						$html = $frm_contact->ho_ten;
						$html .= $frm_contact->email;
						$html .= $frm_contact->tieu_de;
						$html .= $frm_contact->noi_dung;
						$html .= $frm_contact->captcha;
						$html .= $frm_contact->buttons;
						echo $html;
					?>
				</dl>
				<?php echo '</form>'; ?>
			</div>
			<div class="clear"></div>
		</div>
	</div>
	<div class="box">
		<h3 class="header">
			<span>Bản đồ</span>
		</h3>
		<div class="box-content">
			<div id="map_canvas"></div>
		</div>
	</div>
</div>